﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSCommonUtils
{
    public class ListUtils
    {

        /// <summary>
        /// 返回列表的切片,从start开始，end不包含在内
        /// </summary>
        /// <param name="inputList"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <returns></returns>
        public static List<T> Slice<T>(List<T> inputList, int start, int end)
        {
            int elementCount = end - start;
            return inputList.Skip(start).Take(elementCount).ToList();
        }
    }
}
